package com.epam.webproject.restaurant.jaxb.entities;

import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.Date;

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Bill", namespace = "http://www.example.com/bills", propOrder = {
        "id",
        "idOrder",
        "amount",
        "cookedDate",
        "deliveredDate"
})
public class Bill {

    @XmlElement(required = true)
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    @XmlID
    @XmlSchemaType(name = "ID")
    protected String id;
    @XmlElement(required = true)
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    @XmlID
    @XmlSchemaType(name = "ID")
    protected String idOrder;
    @XmlElement(required = true)
    protected int amount;
    @XmlElement(required = true)
    @XmlSchemaType(name = "dateTime")
    protected Date cookedDate;
    @XmlElement(required = true)
    @XmlSchemaType(name = "dateTime")
    protected Date deliveredDate;

    public String getId() {
        return id;
    }

    public void setId(String value) {
        this.id = value;
    }

    public String getIdOrder() {
        return idOrder;
    }

    public void setIdOrder(String value) {
        this.idOrder = value;
    }

    public int getAmount() {
        return amount;
    }

    public void setAmount(int value) {
        this.amount = value;
    }

    public Date getCookedDate() {
        return cookedDate;
    }

    public void setCookedDate(Date value) {
        this.cookedDate = value;
    }

    public Date getDeliveredDate() {
        return deliveredDate;
    }

    public void setDeliveredDate(Date value) {
        this.deliveredDate = value;
    }

    public Bill() {

    }

    public Bill(String id, String idOrder, int amount, Date cookedDate, Date deliveredDate) {
        this.id = id;
        this.idOrder = idOrder;
        this.amount = amount;
        this.cookedDate = cookedDate;
        this.deliveredDate = deliveredDate;
    }

    @Override
    public String toString() {
        return "Bill{" +
                "id='" + id + '\'' +
                ", idOrder='" + idOrder + '\'' +
                ", amount=" + amount +
                ", cookedDate=" + cookedDate +
                ", deliveredDate=" + deliveredDate +
                '}';
    }

}